//
//  IntroductionController.m
//  FruitsWholesaler
//
//  Created by sgone-2 on 16/4/29.
//  Copyright © 2016年 sgone. All rights reserved.
//

#import "IntroductionController.h"
#define kImageCount 3
#import "MyMainViewController.h"

@interface IntroductionController ()<UIScrollViewDelegate>


@property(nonatomic,strong) UIScrollView *pageScroll;
@property(nonatomic,strong) UIImageView *imageV1;
@property(nonatomic,strong) UIImageView *imageV2;
@property(nonatomic,strong) UIImageView *imageV3;
@property(nonatomic,strong) UIImageView *imageV4;
@property(nonatomic,strong)UIPageControl *pageControl;


@property(nonatomic,assign) BOOL isEnd;


@end

@implementation IntroductionController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.titleLabel.text = @"功能介绍";
    self.backBtn.hidden = NO;

    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 64, ViewWidth, ViewHeight-64)];
    [scrollView setContentSize:CGSizeMake(ViewWidth*3, 0)];
    //    打开分页属性
    scrollView.pagingEnabled = YES;
    scrollView.backgroundColor = [UIColor lightGrayColor];
    
    //    [scrollView setPagingEnabled:YES];  //视图整页显示
    scrollView.bounces = NO; //避免弹跳效果,避免把根视图露出来
    
    UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, ViewWidth, ViewHeight-64)];
    [imageview setImage:[UIImage imageNamed:@"4-1"]];
    imageview.contentMode = UIViewContentModeScaleToFill;
    [scrollView addSubview:imageview];
    
    
    UIImageView *imageview1 = [[UIImageView alloc] initWithFrame:CGRectMake(ViewWidth, 0, ViewWidth, ViewHeight-64)];
    [imageview1 setImage:[UIImage imageNamed:@"4-2"]];
    imageview1.contentMode = UIViewContentModeScaleToFill;
    [scrollView addSubview:imageview1];
    
    
    UIImageView *imageview2 = [[UIImageView alloc] initWithFrame:CGRectMake(ViewWidth*2, 0, ViewWidth, ViewHeight-64)];
    [imageview2 setImage:[UIImage imageNamed:@"4-3"]];
    imageview2.contentMode = UIViewContentModeScaleToFill;
    [scrollView addSubview:imageview2];
    imageview2.userInteractionEnabled = YES;
    
    

    
    
    
    
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];//在imageview3上加载一个透明的button
//    [button setTitle:nil forState:UIControlStateNormal];
//    [button setFrame:CGRectMake(0, 0, ViewWidth, ViewHeight)];
//    [button addTarget:self action:@selector(go:) forControlEvents:UIControlEventTouchUpInside];
//    button.backgroundColor = [UIColor clearColor];
//    [imageview2 addSubview:button];
    
    
    
    [self.view addSubview:scrollView];

    
  
    
}


-(void)go:(id)sender
{
    
    
    
    MyMainViewController *ma = [[MyMainViewController alloc]init];
    
    [self presentViewController:ma animated:YES completion:nil];
    
}
@end
